-
Notifications
You must be signed in to change notification settings - Fork 1.8k
overhaul mutex_{atomic,integer}
#15632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Lintcheck changes for 778da58
This comment will be updated if you push new changes |
|
Oh, looking at Lintcheck, I'll also need to (re-)add a EDIT: Although that wasn't actually linted before -- what Lintcheck shows is the mutex being created for a struct constructor, but that's arguably another instance of linting use, not declaration, so linting on field definitions would be a nice addition, but probably best left to after the feature freeze |
This comment has been minimized.
This comment has been minimized.
- The main message should point out what's wrong, not directly suggest a solution. - The second part of the message is a separate advice, so it should be emitted separately.
`Mutex<*const _>` doesn't make a lot of sense (there can be no contention over a read-only reference), but `AtomicPtr::new(*const _)` straight up doesn't compile
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
When I saw the lines added, I thought I'd be in for a longer review, but laudably most of the lines are in tests added. So this looks good to me. Thanks! |
clippy::mutex_integerlints on uses ofMutex<{integer}>, not just definitions #13378)Mutex<*const T>(see the corresponding commit for context)The last change might be deemed a bit too much for the feature freeze, but it can be easily extracted out into a separate PR.
changelog: [
mutex_atomic]: only lint the definitions, not useschangelog: [
mutex_atomic]: better help messages, and suggestionschangelog: [
mutex_atomic]: don't lintMutex<*const T>changelog: [
mutex_integer]: only lint the definitions, not useschangelog: [
mutex_integer]: better help messages, and suggestions